/****************************************************
 * Description: Service for 角色
 * Copyright:   Copyright (c) 2013
 * Company:     beiwaionline
 * @author      bfsu
 * @version     1.0
 * @see
	HISTORY
    *  2013-08-08 bfsu Create File
**************************************************/

package com.bfsuolframework.security.service;

import java.util.List;

import com.bfsuolframework.security.entity.Role;
import com.bfsuolframework.security.entity.RolePrivilege;
import com.bfsuolframework.security.entity.dto.TreeNode;
import com.bfsuolframework.core.controller.support.Pagination;
import com.bfsuolframework.core.service.Service;

public interface RoleService extends Service<Role>{
	
	/**
	 * 通过角色id取得权限树
	 * @param roleid
	 * @return
	 */
	public List<TreeNode> listpri(Long roleid);
	
	/**
	 * 添加或修改权限
	 * @param roleid
	 * @return
	 */
	public String savepri(Long roleid, String codes);
	
	/**
	 * 校验角色代码是否唯一
	 * @param code
	 * @return
	 */
	public boolean checkCode(Role role);
	
	/**
	 * 校验是否有关联表
	 * @param id
	 * @return
	 */
	public String checkDel(Long id);
	
	/**
	 * 加了校验之后的批量删除
	 * @param ids
	 * @return
	 */
	public String deleteAll(Long[] ids);

	public Pagination findRolesNotInGroup(Long groupId, String roleName, Pagination page);
	/**
	 * 获取角色权限
	 * @param roleId
	 * @return
	 */
	public List<RolePrivilege> findPrivilegeByRole(Long roleId);
	/**
	 * 根据角色编码获取角色
	 * @param roleCode
	 * @return
	 */
	public Role getByCode(String roleCode);
}
